import java.util.Scanner;

import static java.lang.System.in;





public class Test {

    static class  TreeNode{
        public char val;
        public TreeNode left;
        public TreeNode right;

        public TreeNode(char val){
            this.val = val;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(in.hasNextLine()){
            String str = in.nextLine();
            TreeNode root = creatrTree(str);

        }
    }


    public static int i = 0;
    public static TreeNode creatrTree(String str){

        TreeNode root = null;
        if(str.charAt(i) != '#'){
            root = new TreeNode(str.charAt(i));//实例化一个节点
            i++;
            root.left = creatrTree(str);
            root.right = creatrTree(str);
        }else{
            i++;
        }
        return root;
    }
}
